using System;
using System.Collections;
using System.Text;

using ObjectRelationalMapping.Helper;

namespace ObjectRelationalMapping.Model
{
    internal class Entity
    {
        internal Entity ( )
        {
            metaclass = new Metaclass ();
            metadata = new Metadata ();
        }

        internal string ClassName
        {
            get { return Common.RemovePrefix ( Name ); }
        }

        internal string ClassTemplate
        {
            get { return classTemplate; }
            set { classTemplate = value; }
        }

        internal string DatabaseTemplate
        {
            get { return databaseTemplate; }
            set { databaseTemplate = value; }
        }

        internal Metaclass Metaclass
        {
            get { return metaclass; }
            set { metaclass = value; }
        }

        internal Metadata Metadata
        {
            get { return metadata; }
            set { metadata = value; }
        }

        internal string Name
        {
            get { return name; }
            set { name = value; }
        }

        private string classTemplate;
        private string databaseTemplate;
        private Metaclass metaclass;
        private Metadata metadata;
        private string name;
    }

    internal class EntityCollection : CollectionBase
    {
        internal Entity this[ int index ]
        {
            get { return ( Entity )( List[ index ] ); }
            set { List[ index ] = value; }
        }

        internal int Add ( Entity entity )
        {
            return List.Add ( entity );
        }
    }
}